import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/home.vue'
import subject from '../views/subject.vue'
import classify from '../views/classify.vue'
import shoppingTrolley from '../views/shoppingTrolley.vue'
import mine from '../views/mine.vue'
import searchPop from "../views/searchPop.vue"

Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    redirect:"/home"
  },
  {
    path: '/home',
    name: 'home',
    component: home,
    children:[{
      path:'searchPop',
      name:'searchPop',
      component: searchPop,
    }]
  },
  {
    path: '/subject',
    name: 'subject',
    component: subject,
  },
  {
    path: '/classify',
    name: 'classify',
    component: classify
  },
  {
    path: '/shoppingTrolley',
    name: 'shoppingTrolley',
    component: shoppingTrolley
  },
  {
    path: '/mine',
    name: 'mine',
    component: mine
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
